<?php 
include_once 'top.php' ;
include_once 'include/sendemail.class.php';
if($_POST){
	$content=$_POST['content'];
	$title=$_POST['title'];
	$mailto=explode(',',$_POST['mailto']);
	$msg = $content;
	$mailsubject = "=?UTF-8?B?".base64_encode($title)."?=";//邮件主题
	$mailbody = '<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />'.$msg;//邮件内容
	$mailtype = "HTML";//邮件格式（HTML/TXT）,TXT为文本邮件
	##########################################
	for($i=0;$i<count($mailto);$i++){
		$smtp[$i] = new smtp($smtpserver,$smtpserverport,true,$smtpuser,$smtppass);//这里面的一个true是表示使用身份验证,否则不使用身份验证.
		$smtp[$i]->debug = FALSE;   //是否显示发送的调试信息,当前为不调试
		$smtp[$i]->sendmail($mailto[$i], $smtpusermail, $mailsubject, $mailbody, $mailtype);
	}
    echo '<script type="text/javascript">alert("Sent successfully!");</script>';
}
?>
<div class="centerbg">
<div class="allbody">
    <div class="bd">
      <div class="nytitle">
        <div class="fl title">MAIL</div>
        <div class="clear"></div>
      </div>
       <!---->
       <form action="" method="post">
    <table width="100%" border="0" cellspacing="0" cellpadding="0" class="full_add_table">
    <tr>
      <td height="35" colspan="2" align="right"></td>
      </tr>
    <tr>
      <td width="21%" height="35" align="right">Mail Addressee：</td>
      <td width="79%"><input name="mailto" type="text" class="class_input" value=""  />
        <span class="red">*</span><span class="cnote">Each recipient </span></td>
    </tr>
    <tr>
      <td width="21%" height="35" align="right">The message header：</td>
      <td width="79%"><input name="title" type="text" class="class_input" id="title" value=""  />
        <span class="red">*</span><span class="cnote">Required</span></td>
    </tr>
    <tr>
      <td height="304" align="right">Message content：</td>
      <td id="show_content">
      <textarea id="content" name="content"></textarea>
      <script charset="utf-8" src="editor/kindeditor.js"></script>
      <script>KE.show({id:'content',width:'613px',height:'280px',resizeMode:1});</script>
      </td>
    </tr>
  </table>
  <div class="gray_add_bottom">
    <input type="submit" class="blue_submit_btn" style="margin-right:15px;" value="" />
    <input type="button" class="blue_back_btn" onclick="history.go(-1)" value=""  />
  </div>
  </form>
       <!---->
       
       
	</div>
</div>
</div>
<?php include_once 'footer.php' ;?>